package it.univpm.diiga.memorysim.actions;


 


import it.univpm.diiga.memorysim.data.DataPlugin;

import org.eclipse.jface.action.IAction;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.IWorkbenchWindowActionDelegate;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.WorkbenchException;


public class ResetProspective implements IWorkbenchWindowActionDelegate {
	public static IWorkbenchWindow window;
	public static boolean codaprocessi=false;
	public static String ID="it.univpm.diiga.memorysim.perspective";
	/**
	 * The constructor.
	 */
	public ResetProspective() {
	}


	public void run(IAction action) {
		PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().resetPerspective();
		try {
			PlatformUI.getWorkbench().getActiveWorkbenchWindow().getWorkbench().showPerspective(ID, window);
		} catch (WorkbenchException e) {
			MessageDialog.openInformation(window.getShell(),"Open Perspective",e.getMessage());
		}
		DataPlugin.reset();
	}


	public void selectionChanged(IAction action, ISelection selection) {
	}


	public void dispose() {
	}


	@SuppressWarnings("static-access")
	public void init(IWorkbenchWindow window) {
		this.window = window;
	}
}